﻿myApp.controller('GalleryController', function ($scope, $http, $modal, modalService, $sce, ngTableParams, $filter) {
    document.title = "Penang Realty 世界地產 Gallery";

    $scope.$emit('newPageLoaded', { 'title': 'Penang Realty BUY OR RENT WITH US 世界地產 Gallery', 'description': 'Beautiful property photos in Penang.' });
    $scope.images = [];
    pageInit();
    
    function pageInit() {
        $scope.loader = { loading: true };
        var url = 'api/Page/GetGallery';
        $http.get(url).success(function (data) {
            $scope.data.images = data;
            angular.forEach(data, function (value) {
                $scope.images.push({ thumb: value.thumnail, img: value.pictureURL, description: value.Description });
            })
            console.log( $scope.images);

            $scope.loader.loading = false;
        })
   }


    $scope.data.images = [
        { thumb: 'images/appstore.jpg', img: 'images/close.png', description: 'Image 1' },
    
    ];


})